#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int x, a, b, c;
	scanf("%d", &x);
	a = x % 10;
	b = x / 100;
	c = x / 10 % 10;
	printf("%d", a * 100 + c * 10 + b);
	return 0;
}